package org.marsson.bNav;

import java.awt.Image;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

import javax.swing.ImageIcon;

public enum Ships {
	SPLASH  (7,new ImageIcon("src/main/resources/splash.gif"),new ImageIcon("src/main/resources/splash.gif"),"Agua",1),
	CARRIER  (1,new ImageIcon("src/main/resources/carrier.gif"),new ImageIcon("src/main/resources/carrierv.gif"),"Carrier",5),
	SEAWOLF (2,new ImageIcon("src/main/resources/seawolf.gif"),new ImageIcon("src/main/resources/seawolfv.gif"),"Seawolf",4),
	BATTLESHIP (3,new ImageIcon("src/main/resources/battleship.gif"),new ImageIcon("src/main/resources/battleshipv.gif"),"Battleship",4),
	SUBMARINE (4,new ImageIcon("src/main/resources/submarine.gif"),new ImageIcon("src/main/resources/submarinev.gif"),"Submarine",3),
	PATROL (5,new ImageIcon("src/main/resources/patrol.gif"),new ImageIcon("src/main/resources/patrolv.gif"),"Patrol",2),
	FIRE (6,new ImageIcon("src/main/resources/fire.gif"),new ImageIcon("src/main/resources/fire.gif"),"Acertou",1);
	
	private static final Map<Integer,Ships> lookup = new HashMap<Integer,Ships>();
	static {
        for(Ships s : EnumSet.allOf(Ships.class))
             lookup.put(s.index(), s);
   }


    public final int index;  
    public final ImageIcon imageH; // imagem na horizontal
    public final ImageIcon imageV;// imagem na vertical
    public final String text;
    public final int size;
    
    Ships(int index, ImageIcon imageH, ImageIcon imageV, String text, int size) {
        this.index=index;
        this.imageH=imageH;
        this.imageV=imageV;
        this.text=text;
        this.size = size;
    }
    public int index()   { return index; }
    public ImageIcon imageH() { return imageH; }
    public ImageIcon imageV() { return imageV; }
    public String text() { return text; }
    public static Ships get(int code) { 
        return lookup.get(code); 
   }
    public int size() { return size; }

 

}
